package com.example.studentportrait.controller.frontend.teacher;

import com.example.studentportrait.domain.ResponseResult;
import com.example.studentportrait.domain.entity.CompetitionAuthenticate;
import com.example.studentportrait.domain.entity.Item;
import com.example.studentportrait.service.CompetitionService;
import com.example.studentportrait.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/teacher")
public class CompetitionController {

    @Autowired
    CompetitionService competitionService;

    /**
     * 教师端查询竞赛列表
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    @GetMapping("/competitionList")
    public ResponseResult competitionList(Integer pageNum, Integer pageSize, Integer status){
        return competitionService.competitionList(pageNum,  pageSize,  status);
    }

    /**
     * 教师端审核竞赛
     * @param competitionAuthenticate
     * @return
     */
    @PutMapping("/reviewCompetitionById")
    public ResponseResult<CompetitionAuthenticate> reviewCompetitionById(@RequestBody CompetitionAuthenticate competitionAuthenticate){
        return competitionService.reviewCompetitionById(competitionAuthenticate);
    }

}
